#ifndef CIOPS_OP_CREATETRIANGLE_H
#define CIOPS_OP_CREATETRIANGLE_H

#include <strstream>

#include "Operation.h"

namespace CIOps {
    /**
     * This class represents the operation of creation of a triangle   
     **/
    class OP_CreateTriangle : public Operation {    

    public:            
        OP_CreateTriangle (std::vector<CIView::View*>& v);      //Constructor
        virtual ~OP_CreateTriangle();                           //Destructor

    protected:
        CIGeom::Geometry* geometry;                         //A pointer to the geometry that will contain the new triangle
        CICore::VertexLib triangle_vertices;                //The triangle vertices
        int vertexCounter;                                  //The triangle vertex counter
        CICore::Face* face;                                 //The face representing the new triangle
        std::map<CIGeom::Geometry*,bool> unifiedGeometries; //Map to store a pointer to the geometry unified through the triangle creation

    public:            
        //Utility Methods
        virtual int Exec();         //Method called to execute directly the operation
        virtual void Undo();        //Method called to undo the operation
        virtual void Redo();        //Method called to redo the operation

        virtual void MousePressEvent (CIView::View* view, QMouseEvent* e);        //Mouse Pressed event handler
        virtual void MouseReleaseEvent (CIView::View* view, QMouseEvent* e);      //Mouse Released event handler
        virtual void MouseMoveEvent (CIView::View* view, QMouseEvent* e);         //Mouse Moved event handler
        virtual void WheelEvent (CIView::View* view, QWheelEvent* e);             //Wheel event handler
    };
}

#endif /* CIOPS_OP_CREATETRIANGLE_H */
